package cn.bjtu.shakingnewsbrowser;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class NewsActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_news);
        WebView webView = findViewById(R.id.web_frame);
//        允许javascript
        webView.getSettings().setJavaScriptEnabled(true);
//        设置新的网页仍在当前页中进行跳转
        webView.setWebViewClient(new WebViewClient());
        webView.loadUrl("https://baidu.com");
    }
}